Computing.Net > Forums > Programming > Format change of a file

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.

Format change of a file

Reply to Message Icon

Name: 504622202
Date: March 6, 2009 at 00:58:16 Pacific
OS: UNIX
Subcategory: General
Comment:

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



Sponsored Link
Ads by Google

Response Number 1
Name: Holla
Date: March 6, 2009 at 02:02:44 Pacific
Reply:

for /f %%a in (input.txt) do echo . | set /p t=%%a >> output.txt

--
Holla.


0

Response Number 2
Name: Mechanix2Go
Date: March 6, 2009 at 03:04:44 Pacific
Reply:

Holla,

Is that unix?


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

M2


0

Response Number 3
Name: nails
Date: March 6, 2009 at 06:35:46 Pacific
Reply:

This places the entire file on one line:

xargs < datafile.txt


0

Response Number 4
Name: Holla
Date: March 6, 2009 at 19:02:28 Pacific
Reply:

oops!
scratch that

--
Holla.


0

Response Number 5
Name: Judago
Date: March 6, 2009 at 20:21:41 Pacific
Reply:

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)


0

Related Posts

See More



Response Number 6
Name: nails
Date: March 7, 2009 at 08:01:57 Pacific
Reply:

Judago:

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

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


0

Response Number 7
Name: 504622202
Date: March 8, 2009 at 21:03:54 Pacific
Reply:

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.


0

Response Number 8
Name: 504622202
Date: March 8, 2009 at 21:47:27 Pacific
Reply:

Hi GUys i want my output for

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


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

like

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


0

Sponsored Link
Ads by Google
Reply to Message Icon






Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Format change of a file

Icon of a file www.computing.net/answers/programming/icon-of-a-file/6002.html

Length of a file in C www.computing.net/answers/programming/length-of-a-file-in-c/831.html

C++ determining the size of a file www.computing.net/answers/programming/c-determining-the-size-of-a-file/13503.html