- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: change lines in text file
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-05-2007 12:55 AM
тАО01-05-2007 12:55 AM
I need a script to work a file whith this ouptut:
EI_FNC-ARCH-DIA
01/05/07 14:00:00
EI_TERC-ARCH-DIA
01/05/07 16:00:00
EI_PDL-ARCH-DIA
01/05/07 15:30:00
and change that output to this:
EI_FNC-ARCH-DIA|01/05/07|14:00:00
EI_TERC-ARCH-DIA|01/05/07|16:00:00
EI_PDL-ARCH-DIA|01/05/07|15:30:00
Thanks for all,
JT
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-05-2007 01:05 AM
тАО01-05-2007 01:05 AM
Re: change lines in text file
awk '/EI/{getline t;print $0 t;next}' filename
regards,
ivan
- Tags:
- awk
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-05-2007 01:07 AM
- Tags:
- sed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-05-2007 01:15 AM
тАО01-05-2007 01:15 AM
Re: change lines in text file
a quick and dirty shellscript:
cat datafile |
while read L1; do
if [ -z "$L1" ]; then
: # do nothing
else
read L2
echo "$L1 $L2"
fi
done | sed "s/ /|/g"
rgds
HGH
- Tags:
- while loop
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-05-2007 01:18 AM
тАО01-05-2007 01:18 AM
Re: change lines in text file
awk '/EI/{getline t;print $0 "|" t;next}' filename
regards,
ivan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-05-2007 01:29 AM
тАО01-05-2007 01:29 AM