[Solved] Printing a part of the last line of the specific part of a file
Hi,
I have 80 large files, from which I want to get a specific value to run a Bash script. Firstly, I want to get the part of a file which contains this:
This is necessary because in a file there are written more lines which contains a string "Value =[...]"
Next, I want to get the value 57 and assign it to a variable (this is an example because each file has different value)
I tried to use this command:
Unfortunately, this command runs very slow for 80 files.
I tried also to use this command:
However, I'd rather not define the amount of lines which should be skipped because it is possible to insert a newline in that file and in this case the script won't work.
Can anyone help me with this?
Thanks
Moderator's Comments:
Please use code tags when posting data and code samples!
Last edited by vgersh99; 09-03-2012 at 10:05 AM..
Reason: code tags, please!
I have a requirement to go to particular line in the file and from there read the contents till it meets a particular criteria. For eg if the contents of the file is like
81 abcd ------------------- Line 1
82 cdfe ------------------- Line 2
83 dfj ------------------- Line 3
84 df... (5 Replies)
hi
I have the input as follows
ABC =893
JKL = "jee"
alias PQR = 9833
alias STUVE = "kuiue"
I should be able to print as follows
ABC
JKL
alias PQR
alias STUVE
Thanks
Suresh (7 Replies)
I have a whole file structure with jpeg files where I want to remove a part of the file name. An application added in many files a case conflict in the naming "xyz 017.jpg (Case Conflict 1)"
So, can someone help me how to get rid of the " (Case Conflict 1)"? What I have is this:
find . -name... (2 Replies)
Hi,
I have a input files as below.
Sample of one input file
type mtg_key =
record
decimal("\344") id;
string("\344") ct_cd;
string("\344") st_cd;
end;
type psl_key =
record
decimal("\344") id;
utf8 string("\344") st_cd;
end;
type amk_fields =
record
... (6 Replies)
Hey guy's....
I new here,
But im working on a school project, and I am not really good at programming. In fact, this is the only programming class that I need because programming is not what I am majoring in.
But I have everything done in this shell script except for this last part.....
... (9 Replies)
I need some help. I would like to read in a text file.
Take a variable such as ROW-D-01, compare it to what's in one line in the text file such as PROD/VM/ROW-D-01 and only input PROD/VM into a variable without the /ROW-D-01.
Is this possible? any help is appreciated. (2 Replies)
Hi,
I have a file with thousands of lines as below
INSERT INTO T_DIM_CLNT(CLNT_KY,CLNT_OBJ_ID,ISI_CLNT_ID,OPERN_ID,CLNT_NM,PRMRY_SIC_CD,PRMRY_SIC_DSC,RET_AGE_NBR,REC_CRT_TS,REC_DATA_EXTRC_TS,ETL_LOG_KY)
VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)... (5 Replies)
I have a variable and assigned the following values
***XYZ_201519_20150929140642_20150929140644_211_0_0_211
I need to read this variable from backward and stop read when I get first underscore (_)
In this scenario I should get 211
Thanks
Kris (3 Replies)
Hello Folks,
I have an requirement, where i need to get total count of the file based on creation date with there filename selected pattern.
Filename: MobileProtocol.20171228T154200.157115.udr
I want to get the count of files created on each day based on a pattern find.
find . -type... (7 Replies)
Hi All,
We've a VDI infrastructure in AWS (AWS workspaces) and we're planning to automate the process of provisioning workspaces. Instead of going to GUI console, and launching workspaces by selecting individual users is little time consuming. Thus, I want to create them in bunches from AWS CLI... (6 Replies)