10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
data:
bblah1_blah2_blah3_blah4_blah5
bblahA_blahB_blahC_blahD_blahE
im using the following code to grab the field i want:
cat data | while IFS='_' read v1 v2 v3 v4 v5; do printf '%s\n' "${v4}"; done
im catting data here. in the real world, the exact content of data will be in a variable.... (4 Replies)
Discussion started by: SkySmart
4 Replies
2. Shell Programming and Scripting
Trying to use perl to output specific fields from all text files in a directory to one new file. Each text file on a new line. The below seems to work for one text file but not more. Thank you :).
perl -ne 's/^#//; @n = (6, 7, 8, 16); print if $. ~~ @n' *.txt > out.txt
format of all text... (2 Replies)
Discussion started by: cmccabe
2 Replies
3. Shell Programming and Scripting
Hi all,
I have a flatfile 300 lines
tiger,tampa10-pc,yellow,none,2013-02-25 08:56:51.000,2013-02-25 21:41:11.380,12hrs : 44min
cat,tampa10-pc,white,none,2013-02-28 08:56:58.000,2013-03-04 23:18:23.003,110hrs : 21min
dog,tampa10-pc,yellow,none,2013-03-05 09:50:17.000,2013-03-07... (5 Replies)
Discussion started by: sabercats
5 Replies
4. Shell Programming and Scripting
Hi All,
I am writing the following Perl Scrip and need your help in Pattern matching :
I have the following Shell Script that would read line by line from the file (file_svn) and would inturn calls the Perl Script:
#!/bin/bash
perl_path="/home/dev/filter"... (2 Replies)
Discussion started by: filter
2 Replies
5. Shell Programming and Scripting
Hello Everyone,
I've googled everywhere for this with no luck and my brain hurts.
I'm trying to write a program to take my webpages and search for forms.
I've used LWP::Simple to store a website in $content
I need to cut the form out of $content. I don't know how to do this seeing as how... (2 Replies)
Discussion started by: wibbs
2 Replies
6. Shell Programming and Scripting
Hi,
I want to split/parse certain bits of the hex data into another field.
Example:
Input data is
Word1: 4f72abfd
Output:
Parse bits (5 to 0) into field word1data1=0x00cd=205 decimal
Parse bits (7 to 6) into field word1data2=0x000c=12 decimal
etc.
Word2: efff3d02
Parse bits (13 to... (1 Reply)
Discussion started by: morrbie
1 Replies
7. Shell Programming and Scripting
Howdy!
I have multiple files with tab-separated data:
File1_filtered.txt
gnl|Amel_4.0|Group3.29 1 G R 42 42 60 15 ,.AAA.aa,aa.A.. hh00/f//hD/h/hh
gnl|Amel_4.0|Group3.29 2 C Y 36 36 60 5 T.,T, LggJh
gnl|Amel_4.0|Group3.29 3 A R 27 27 60 9 Gg,,.gg., B6hcc22_c
File2_filtered.txt
... (3 Replies)
Discussion started by: sramirez
3 Replies
8. Shell Programming and Scripting
ok, so a script i wrote spits out an output like the below:
2,JABABA,BV=114,CV=1,DF=-113,PCT=99.1228%
as you can see, each field is separated by a comma. now, how can I get rid of the first field and ONLY show the rest of the fields.
meaning,
i want to get rid of the "2,", and... (3 Replies)
Discussion started by: SkySmart
3 Replies
9. Shell Programming and Scripting
Alright,
I'm new to Perl so be gentle. Given the following script:
----
open(file, "<file.txt");
@lines = <file>;
close(file);
$var = print $lines;
----
So I'm printing line 18 of the file "file.txt". I now want the 5th column, minus the forward slash. The line looks like this:
... (2 Replies)
Discussion started by: wxornot
2 Replies
10. Shell Programming and Scripting
I get the perl date in the following format:
Mon Jan 31 06:01:37 2005
How can I extract each field in a single line using a regular expression??
I dont want to use "split".
Any other way out??
JP :) (2 Replies)
Discussion started by: jyotipg
2 Replies