nixCraft Linux Forum

nixCraft

Linux Tech Support Forum

Rearange Data from a file to another

This is a discussion on Rearange Data from a file to another within the Shell scripting forums, part of the Development/Scripting category; Hi, I'm working on linux platform and I need help to do this. I have a Text file which look ...


Go Back   nixCraft Linux Forum > Development/Scripting > Shell scripting

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 03-25-2008, 03:34 PM
Junior Member
User
 
Join Date: Mar 2008
My distro: Debian
Posts: 1
Rep Power: 0
sebastanov is on a distinguished road
Default Rearange Data from a file to another

Hi,
I'm working on linux platform and I need help to do this.

I have a Text file which look kike that.
---------------
XMID
YMID
ZMID


(I,J) I= 25

25 226962.6
25 3391522.
25 1937.401
--------
And I want to exctract the 3 numbers writen after the '25' and write them in an onther file in line, not in column.
I mean that it should look like that:

----
Blalblablabla
blablablabl

226962.6 3391522. 1937.401
-------
Can somone help me with that?

THank you in advance.
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 04-16-2008, 10:46 AM
agn agn is offline
Member
User
 
Join Date: Feb 2008
My distro: OpenBSD/FreeBSD/Debian/Fedora/RHEL
Posts: 69
Rep Power: 1
agn is on a distinguished road
Default

Code:
$ awk '/^25/ { ORS=" "; print $NF }' buf
226962.6 3391522. 1937.401
Is this what you want ?
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
Parse XML file and store data in array in shell scripting Nishanthhampali Shell scripting 5 02-14-2008 11:57 AM
get data mysql from shell alpa Shell scripting 1 05-14-2007 06:02 PM
Script for accessing data .. Dastard Shell scripting 1 07-25-2006 11:12 PM
print data to txt rock Shell scripting 1 03-10-2006 02:01 AM
script to rewrite data. kavi Shell scripting 3 09-18-2005 12:13 AM


All times are GMT +5.5. The time now is 05:43 AM.


Powered by vBulletin® Version 3.7.2 - Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36