extracting part of a line excluding particular word from it
here is the line on which i want to process
it sometimes doesnt have comma at the end too
i want to extract all except "AUTO_INCREMENT" not only this line i ,want the code to work on any line if it has AUTO_INCREMENT... i can do this using string manipulation like
but this is lengthy so is there any one liners to do the above function.... :-/
let say the input file is
the above lines are in a file...
i will be reading them in a while loop.. so it will be stored in a variable called $line
in the above condition it is 'empno' but lets say we have
since the while loop is dynamic it should work for all formats...
---------- Post updated at 12:27 PM ---------- Previous update was at 12:17 PM ----------
i have one more doubt.. say i have some contents in two variables
$aaa and $bbb.... say $aaa has "vivek" and $bbb has "ViVeK"
so if i perform below..
it satisfies only if case is same... is there anyway i could compare case insesitively..?
where is the input variable in the above line..? if the input line is stored in a variable called $line how to use it in the above statement... and also i want the output to be stored in another variable say $modified...
and also how to compare variables with case insensitive as i asked previously..?
where is the input variable in the above line..? if the input line is stored in a variable called $line how to use it in the above statement... and also i want the output to be stored in another variable say $modified...
and also how to compare variables with case insensitive as i asked previously..?
Assume the input file is called "table2.sql".
It saves the output into a temp file called "output.txt". Then read it line by line with shell script and do your job in the loop.
This User Gave Thanks to MacMonster For This Post:
Hi,
I need help with following. I need to exclude words that match following patterns
a. more than length 4 (example SBRAP)
b. contains mixture uppercase and lower case regardless of the length (example GSpD)
File contains
COFpC
MCHX
SP
SNFCA
GEH
SBRAP
DGICA
JPMpE
WFCpP
GSpD
AXL... (5 Replies)
I have the code
message={TP=2012:09:23:00:00:00:GMT,SD=2012:09:23:00:00:00:GMT,SP=2,FT=CCGT,FG=3605}
I want to extract the FG=3605 parts of this. Please help. I am trying to do this using awk or unix. (5 Replies)
Hello,
When i run this command
find ./ -type f -print | xargs grep -l 'myWord'
it prints the file name where 'myWord' exists and also something like the below which i want to exclude
grep: can't open Fields
grep: can't open Search
I tried piping and grep -v 'open' but it did not work.
... (3 Replies)
Hello All,
I have a text file with contents as below:
contents of error.txt:
message1="Reason for error code1"
message2="Reason for error code2"
message3="Reason for error code3.
To solve this, you may try doing restart"
I have a requirement where in I have to... (4 Replies)
Hello Experts,
Can you please help me by providing a code which can give me the complete path except last word in a variable, the variable i can use anywhere else for my operation
eg:
if this below one is my path:
... (3 Replies)
Hi all,
FileOne
family balance >>>>>
0 0
0 0
java.io.FileNotFoundException: Settings.xml (No such file or directory)
at java.io.FileInputStream.open(Native Method)
..
....
.....
.....
java.lang.NullPointerException
...
.....
......
Stacktrace:
at... (2 Replies)
Hi,
I have data which is having '|' as delimiter and have lobfilename/locations in the data.
Ex:
1200|name1|lobfilename.0.600|abcd
1201|name2|lobfilename.600.1300|abcd
My requirement is to print part of the line till the lobfilename and write to a different file and also print the... (4 Replies)
Hi,
I have a file few hundred MB's with text like one below in single line.
20091117 abc xyg 20091117 def ghi 20091118 ppp ttt 20091118 zzz zzz xxx
I need to extract part of line from 1st occurence of pattern 20091117
till first occurence of another pattern 20091118.
I tried... (3 Replies)
I have a file that lists data about a system. It has a part that can look like:
the errors I'm looking for with other errors:
Alerts
Password Incorrect
Login Error
Another Error
Another Error 2
Other Info
or, just the errors I need to parse for:
Alerts
Password Incorrect
... (9 Replies)