![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| selecting only few lines from many based on a common pattern | damansingh | Shell Programming and Scripting | 2 | 05-28-2008 06:29 AM |
| Help with selecting specific lines in a large file | tansha | UNIX for Dummies Questions & Answers | 2 | 02-06-2008 08:26 AM |
| Urgent: selecting unique specific content of a file using shell script | jisha | Shell Programming and Scripting | 2 | 01-08-2008 08:45 AM |
| need help--script to filter specific lines from multiple txt files | I-1 | Shell Programming and Scripting | 7 | 02-16-2007 08:42 PM |
| Shell Script to read specific lines in a file | varshanswamy | Shell Programming and Scripting | 5 | 08-22-2005 07:12 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
command for selecting specific lines from a script
I need help on following script:
I need to print the lines which are in bold letters in separate file as record string("|") emp_name; string("|") emp_id; decimal("|") emp_salary; string("|") emp_status; string("\n") emp_proj; end Above lines are related to file ${_AB_PROXY_DIR}"'/rf_emp_status_emp_proj-3.dml which is present in 19 th line in below script. The issue is i need to print only specific lines which are in bold letters in separate file. In below script you will find one field record which will be repeating more times . I need to select all that that lines fromrecord field to end of file ${_AB_PROXY_DIR}"'/rf_emp_status_emp_proj-3.dml. Please can you help on sending that bold letter fields into separate file. I am highliting all that lines in below script wich i want in seperate file, in red color print -r -- 'record string("|") emp_name; string("|") emp_id; decimal("\n") emp_salary; end' > "${_AB_PROXY_DIR}"'/in_emp_data-1.dml' print -r -- '/*Reformat operation*/ out::reformat(in) = begin out.*:: in.*; out.emp_status :: if(next_in_sequence()<3) "A" else "D"; out.emp_proj :: "ABC"; end;' > "${_AB_PROXY_DIR}"'/rf_emp_status_emp_proj-2.xfr' print -r -- 'record string("|") emp_name; string("|") emp_id; decimal("|") emp_salary; string("|") emp_status; string("\n") emp_proj; end;' > "${_AB_PROXY_DIR}"'/rf_emp_status_emp_proj-3.dml' print -r -- '/*Reformat operation*/ out::reformat(in) = begin out.*:: in.*; out.emp_loc :: "USA"; end;' > "${_AB_PROXY_DIR}"'/rf_emp_location-4.xfr' print -r -- 'record string("|") emp_name; string("|") emp_id; string("|") emp_salary; string("|") emp_status; string("|") emp_proj; string("\n") emp_loc; end;' > "${_AB_PROXY_DIR}"'/rf_emp_location-5.dml' Thanks, gangadhar. |
|
||||
|
What's the criterion for deciding which part of the file to extract? The name of the output file?
Code:
perl -0777 -pe "s%;' > \"\\$\\{_AB_PROXY_DIR\\}\"'/rf_emp_status_emp_proj-3.dml'.*%%s;
s/^.*print -r -- '//s" file
|
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|