Format change of a file

March 6, 2009 at 00:58:16
Specs: UNIX
hi Guys
i have a file looks like

T
------------
27


B
------------
8

and wants to print them side by side so that they come in a row


See More: Format change of a file

Report •


#1
March 6, 2009 at 02:02:44
for /f %%a in (input.txt) do echo . | set /p t=%%a >> output.txt

--
Holla.


Report •

#2
March 6, 2009 at 03:04:44
Holla,

Is that unix?


=====================================
If at first you don't succeed, you're about average.

M2


Report •

#3
March 6, 2009 at 06:35:46
This places the entire file on one line:

xargs < datafile.txt


Report •

Related Solutions

#4
March 6, 2009 at 19:02:28
oops!
scratch that

--
Holla.


Report •

#5
March 6, 2009 at 20:21:41
I don't know about unix per-say but with a slight modification it seems works under wine 1.0.1 on ubuntu 8.10 - even with wine's built in cmd.exe :)

for /f %%a in (tes.txt) do set /p t=%%a < nul >> output.txt

:) :) :)

I should really learn some shell script.....

(No need to attack me I know how wrong it is)


Report •

#6
March 7, 2009 at 08:01:57
Judago:

Here's a good place to start learning bash shell scripting:

http://tldp.org/LDP/Bash-Beginners-...


Report •

#7
March 8, 2009 at 21:03:54
I don't find anything much of help. %%a is showing unexpected Hola...


and with xargs...everything comes in a same line not like colname on top and values down below.


Report •

#8
March 8, 2009 at 21:47:27
Hi GUys i want my output for

T
------------
27


B
------------
8

like

T B
------------ ------------
27 8


Report •


Ask Question