I need an urgent help with a BASH script. I have file which contains (besides the other data) the lines with the following structure identified by with keyword PCList:
The VALUE can contain any number of items, which can be spread on any number of lines, idented by spaces or TABs as well, bounded by keywords VALUE and RANGE
I need to write scripts which would in three steps
1) join all VALUE items into 1 line separated by SPACE like this:
2) remove last character "
3) add 2 more lines:
Final result should looks like this:
If required scripts are too complicated to compose, as workaround would be accepted also direct replacement of certain single-line VALUE item of PCList structure
by multi-line VALUE:
Can anybody help please ASAP?
Thanks
---------- Post updated at 08:56 PM ---------- Previous update was at 06:28 PM ----------
As still no help, I am trying to do at least workaround mentioned for this problem. I try to use sed to find & replace single line VALUE string (without checking if it is part of PCList structure) like this:
but from this input:
I get this output:
while I would expect only this result:
Can anybody understand and explain why?
I have a file containing two fields, Name and Time, with about 57 lines in this file. I am struggling to create a loop that will cut out the first ten lines of this file and echo it to the screen. Can anybody help me please. (1 Reply)
hey guys, need ur expert help. m a core banker got stuck in someting techie and cant find a solution
have manged to extract a file from oracle apps in a format that looks something like this...
REC- A b c d x
INV- A b... (6 Replies)
Help...please.
I have a log that contains
Warning Authentication Failed: User GHDT88998HS doesn't exit: The User GHDT88998HS could not be found Mar 22, 2008 5:22:22AM com.hometel.ttm.auth.userlogin.
about maybe a thousand entries failed user acct message
How can I grab just the username... (2 Replies)
Hi all,
I need help manipulating the file below.
Here is what I needed to do.
First, I have to replace INSUPD to DELETE.
Then I need to change the content of the file around by flipping the contents in the file from the bottom to the top (start from "CMD")
How should I attack this?
Here... (2 Replies)
Hello everyone,
I am trying to manipulate a large .csv file where I have output similar to the following -
http://imgur.com/TEXD8.png
The result that I am looking for would be to consolidate the first column, but combine the second and third column so it still relates to the first. I... (8 Replies)
Hi,
I need a shell/command to achieve this task.
I've a delimited unloaded file from oracle in a scrambled format as shown below with many blank lines in it, I'm just trying to tailor it in a format that would be compatible to view and load it to a IDS db.
Here is the problem
... (1 Reply)
Hi
I have a file content.txt where I want to replace the value of second column of the file with half of the value of that column.
I only have to replace if the second column starts with COM_, rest all values have to be same
eg,
cat content.txt
|COM_A|123|JHV|8475
|ABC|2765|BV|876... (7 Replies)