Ok, so how many times have you received this request? I have been looking through the forum for examples and I see the use of tr, awk and sed to perform similar functions but not sure how to use the tools in this scenario and could use a push in the right direction.
GOAL:
Search for line breaks and replace with a unique delimiter to import into excel
IDEALLY, create headers with the first part of each line (auth user, description, role) but I can manually remove by doing a search and replace like I will do with the last character { in auth user.
DATA: useraudit.txt
In my newbie ways I am trying to approach it step by step so first try and get everything on one line so I created users.awk
Ran awk -f users.awk useraudit.txt and I get
auth user SVC_Qualys {, description "SVC_Qualys", role guest
Not sure yet how to edit the results for the desired goal... I'll keep plugging away
Thank you for the community help. This forum has been a big help and I love the different ways people take to approach for a solution.
Last edited by vbe; 02-18-2016 at 11:44 AM..
Reason: more code tags
I've got a file like so:
...lots of lines, etc.
push "route 10.8.0.0 255.255.255.0"
push "route 192.168.1.123 255.255.255.0"
...lots of lines, etc.
I want to sed find/replace the IP address in the second line, whatever it is, with a new IP address, but I don't want to touch the first line.... (5 Replies)
i am editing a big log file with the following pattern:
Date: xxxx Updated: name
Some log file text here
Date: eee Updated: ny
Some log file text here
Basically i want to remove all the text in a line before the "Updated" pattern. I sill want to print the other... (4 Replies)
hello everybody,
I have a group of file
eg-
sample1
sample2
sample3
sample4
each file contain this :-
cat sample1
SEQ_NUM,1,UPESI1
My requirement is to
change the value-UPESI1 to UPE10 in file which contain this pattern -UPESI1.
any help is appreciated. (2 Replies)
I have an xml file. I need to convert a particular pattern to lower case and add 1 to it. For example my sample values in file are:
ergeAAwrgersc_DWSTAGE_AC_DBO_TBL_GROUPZONES_INITIAL.badAAergerg
sc_DWSTAGE_AC_DBO_TBL_SECTIONDEPENDENCY_INITIAL.badeAAwrgewrg... (6 Replies)
i have a file which contains lines like this.
intsrcrpttrn1099mctrl:export GRAPHPARM_AR="-input_code M302023"
intsrcrpttrn1099mload:export GRAPHPARM_AR="-input_code M192023"
intsrcrpttrn1099mload:export GRAPHPARM_AR="-input_code P192023"
the value after -input_code starts with some alphabet... (4 Replies)
All,
I have a text file which has the following data
X_SQL_13,X_SQL_14,X_SQL_15,X_SQL_16,X_SQL_17,X_SQL_18,X_SQL_19,X_SQL_20,X_SQL_21,X_SQL_22,X_SQL_23,X_SQL_24,X_SQL_25,X_SQL_26,X_SQL_27,... (4 Replies)
Hi all,
I have requirement where i need to find a pattern and replace it by new word. I used the below perl command
echo `perl -p -i -e "s/AbCdEf/PqRsTu/g;" FileName.txt`
But I am getting an error as below
Can't do inplace edit Not a Owner
and the file FileName.txt gets ... (9 Replies)
Hi I need to help on finding the below pattern using sed
<b><a href="/home/document.do?assetkey=x-y-abcde-1&searchclause=photo">
and replace as below in the same line on the index file.
<b><a href="/abcde.html">
thx in advance.
Mari (5 Replies)
Hi
I am having 2 files file1.c and file2.c
Now i want to find all the occurances of pattern "abc" in file1.c, file2.c and replace with pattern "def" using shell script without using sed and with using sed.
Thanks in advance...
raju (1 Reply)