Moving columns in a txt file

Microsoft Windows xp inside out
August 26, 2009 at 07:03:48
Specs: Windows XP, 2 gig
Hi,

Ive read you post in this forum and you were great.
I just want to ask your help, I have a batch file that contains several records. I have an entry for example 'ABC' in column 247, I need a batch file that will scan my txt file (per record) and move each strings in column 247 to 242 .
Please help.
Thank you very much.

Jesfer



See More: Moving columns in a txt file

Report •


#1
August 27, 2009 at 01:04:36
Is there a header, how are the columns defined?


Report •

#2
August 27, 2009 at 07:39:27
Hi,

There is no header. Lets say, column 247 contains 5characters, it needs to be moved to column 242 (which is empty).

I just need to move column 247 to 242. Pls help.

Thanks,
JM


Report •

#3
August 27, 2009 at 07:56:33
What denotes a column?

Report •

Related Solutions

#4
August 27, 2009 at 08:06:33
A column doensnt have a header and is generated from a different program. That column is mis positionned and should be moved to column 242, which is empty. It is displayed in column 247. It contains a maximum of 5 characters. If possible to move, should have no problem with column 242 because it is empty.

Pls advice.

Thanks,
JM


Report •

#5
August 27, 2009 at 09:37:16
You have yet to specify what separates these columns.

Report •

#6
August 27, 2009 at 09:55:59
Im just thingking, but i dont know hot to implement it in a batch file,
would it be possible to just go to the column number?

Example, ill go to column 242, delete the next 5 spaces, so column 247 will be moved to column 242?

If possible, please help me implement this logic using batch file.

Thank you.


Report •

#7
August 27, 2009 at 09:59:09
example of the file is: (actual character varies on the actual file)

Test ABC 123


Can i move directly 123 two spaces after ABC?
I have few rows in my text file that needs to do the same.

Pls advice.

Thank you


Report •

#8
August 27, 2009 at 10:12:22
Assuming "column" means "character position" (untested):
SETLOCAL ENABLEDELAYEDEXPANSION
FOR /F "usebackq delims=" %%a IN ("input.txt") DO @(SET a=%%a
echo !a:~0,242!!a:~246!) >output.txt


Report •


Ask Question