Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
Using CHANGE.COM
Name: BRDE Date: October 1, 2008 at 07:36:07 Pacific OS: Windows XP CPU/Ram: pentium Product: intel
Comment:
Hi,
I am trying to use CHANGE (http://www.golden-triangle.com/CHANGE.ZIP) in my csv files, but I´m finding problems with the files which have their names with numbers and characters at the same time!
Name: Mechanix2Go Date: October 1, 2008 at 08:58:34 Pacific
Reply:
The chars in filename is not a known issue.
Two things to be aware of:
The file must be pure text.
File size is limited to about 30KB.
============================ What problem are you having.
===================================== If at first you don't succeed, you're about average.
M2
0
Response Number 2
Name: BRDE Date: October 1, 2008 at 09:14:19 Pacific
Reply:
I have for example 3 files in the same folder with the following names: exemplo.csv 123.csv exemplo456.csv (numbers and chars together)
when I try to use CHANGE with them everything goes perfectly with the two first ones (exemplo.csv and 123.csv), but with the third one (exemplo456.csv) I receive the error: File not found
All the files that I´m dealing with have only 1KB.
thks!
BRDE
0
Response Number 3
Name: Mechanix2Go Date: October 1, 2008 at 10:29:32 Pacific
Reply:
The problem with the 3rd filename is it's lemgth.
CHANGE is a DOS [circa 1986] utility and knows NOTHING about LFNs.
Try renaming it to T2.csv
===================================== If at first you don't succeed, you're about average.
M2
0
Response Number 4
Name: BRDE Date: October 2, 2008 at 01:19:28 Pacific
Reply:
You´re right.
I´ll see what I can do so.
Thank you M2.
BRDE
0
Response Number 5
Name: BRDE Date: October 2, 2008 at 02:42:45 Pacific
Reply:
M2
I just have to change all the ";" in my csv files by a TAB. They all have only numbers and ";". I want to change all ";" by a TAB.
The following line works great, but I have problems with the size of my files:
change a2b4c6d8.csv ";" 9
Is there a way of changing the name of the files inside the batch file sequence and them rename it back after the changes?!
Could you give me some help!?
thks again!
BRDE
0
Response Number 6
Name: Mechanix2Go Date: October 2, 2008 at 04:50:28 Pacific
Reply:
@echo off setLocal EnableDelayedExpansion
for /f "tokens=* delims= " %%a in ('dir/b *.csv') do ( copy %%a zzzz change zzzz ";" 9 copy zzzz %%a ) del zzzz
===================================== If at first you don't succeed, you're about average.
M2
0
Response Number 7
Name: BRDE Date: October 2, 2008 at 05:27:30 Pacific
Reply:
Uow!!
Perfect!
Thanks a lot!
0
Response Number 8
Name: klint Date: October 2, 2008 at 08:15:26 Pacific
Reply:
Alternatively, since every file with a long name also has a short name, you can use the short name directly:
for %%a in (*.csv) do change %%~sa ";" 9
0
Response Number 9
Name: BRDE Date: October 16, 2008 at 05:07:06 Pacific
Summary: If this is in xp I would seriously consider using sfk instead of change.com, it can do many thing replacing text is one of them.... It states this in the help "sfk replace" return codes for batch f...
Summary: Hi Nathan, IVO can probably make it work; but not me. One "solution" is to use CHANGE.COM which will work on any text file up to about 32KB. Usage: change.com "stringold" "stringnew" Note: EXACTLY one...
Summary: This may help. Not strictly a batch solution, but maybe a way forward. The batch below saves the orig data.txt, makes a copy and uses CHANGE.COM, available here: Change to replace every ocurrance of ...