I have a text file that has many lines, and for each line I need to extract different sections of text, then write several variables from the data.
I can split out the various sections by selecting their position on each line as the column sizes will never vary.
A sample of my text file is below
the variables and selection criteria i am extracting is here
Now to my specific Question,
for the variable $genderage, I need to delete the first character ( either B or G) and write a new variable called $gend that is either M or F depending on the original letter.
the remaining number could be either a 1 or 2 digit number which I need to write to another veriable $age.
the other question is how to delete all the trailing spaces from the other 2 variables? this can be done either when selection them, or when writing them out to a new file.
$lastnam
$firstnam
TIA
Ken
Last edited by vbe; 08-29-2013 at 10:42 AM..
Reason: indent...
needa c program to extract text between two delimiters from some text file.
and then storing them in to diffrent variables ?
text file like 0:
abc.txt
=========
aaaaaa|11111111|sssssssssss|333333|ddddddddd|34343454564|asass
aaaaaa|11111111|sssssssssss|333333|ddddddddd|34343454564|asass... (7 Replies)
Hi,
This is the first time playing around with perl and need some help.
Assuming if i have a line of text that looks like this:
Date/Time=Nov 18 17:12:11;Device Name=192.168.1.1;Device IP=192.168.1.1;Device Class=IDS;Source IP=155.212.212.111;Source Name=UNKNOWN;Source Port=1679... (3 Replies)
Hi All,
I am having an XML tag like:
<detail sim_ser_no_1="898407109001000090"
imsi_1="452070001000090">
<security>ADM1=????</security>
<security>PIN1=????</security>
<security>PIN2=????</security>
... (2 Replies)
Hello fourm members,
I want to write a script to extarct paticular strings from the all type of files(.sh files,logfiles,txtfiles) and redirect into a log file.
example:
I have to find the line below in the script and extract the uname and Pwds.
sqsh -scia2007 -DD0011uw01 -uciadev... (5 Replies)
I have 1 file that has elements as follows. Also the CVR(10) and the word "SAUCE" only appear once in the file so maybe a grep command would work?
file1
CVR( 9) = 0.385E+05, ! VEHICLE
CVR(10) = 0.246E+05, ! SAUCE
CVR(11) = 0.162E+03, ! VEHICLE
I need to extract the... (6 Replies)
i'm trying to write a bash script that that will automatically extract zip files after the download.
i writed this script
#!/bin/bash
wget -c https://github.com/RonGokhle/kernel-downloader/zipball/master
CURRENDIR=/home/kernel-downloader
cd $CURRENDIR
rm $CURRENDIR/zipfiles 2>/dev/null
... (2 Replies)
Dear community,
I have to do something too hard for me :rolleyes:. I hope you can help me.
This is an output coming from Oracle query, stored in a file called query.out, there are many rows, but I read them, one by one, using while/read/done. Assuming each row is contained into $line variable... (8 Replies)
Hi friend i have input as following XML file
<?xml version="1.0"?>
<Document xmlns="urn:iso:std:iso:20022:tech:xsd:camt.054.001.02">
<BkToCstmrDbtCdtNtfctn>
<GrpHdr><MsgId>LBP-RDJ-TE000000-130042430010001001</MsgId><CreDtTm>2013-01-04T03:21:30</CreDtTm></GrpHdr>... (3 Replies)
Hi,
I need to compare 2 text files with around 60000 rows and 1 column. I need to compare these and write the mismatch data to 3rd file.
File1 - file2 = file3
wc -l file1.txt
58112
wc -l file2.txt
55260
head -5 file1.txt
101214200123
101214700300
101250030067
101214100500... (10 Replies)
Hello Team,
I have 2 files.one contains english text and another contains Japanese. so i have to read english text and replace the text with Japanesh text in third file.
Basically, I need a help to write japanese language in text/xml file.I heard wstring does this.Not sure how do i write... (2 Replies)
Discussion started by: SA_Palani
2 Replies
LEARN ABOUT V7
stty
STTY(1) General Commands Manual STTY(1)NAME
stty - set terminal options
SYNOPSIS
stty [ option ... ]
DESCRIPTION
Stty sets certain I/O options on the current output terminal. With no argument, it reports the current settings of the options. The
option strings are selected from the following set:
even allow even parity
-even disallow even parity
odd allow odd parity
-odd disallow odd parity
raw raw mode input (no erase, kill, interrupt, quit, EOT; parity bit passed back)
-raw negate raw mode
cooked same as `-raw'
cbreak make each character available to read(2) as received; no erase and kill
-cbreak make characters available to read only when newline is received
-nl allow carriage return for new-line, and output CR-LF for carriage return or new-line
nl accept only new-line to end lines
echo echo back every character typed
-echo do not echo characters
lcase map upper case to lower case
-lcase do not map case
-tabs replace tabs by spaces when printing
tabs preserve tabs
ek reset erase and kill characters back to normal # and @
erase c set erase character to c. C can be of the form `^X' which is interpreted as a `control X'.
kill c set kill character to c. `^X' works here also.
cr0 cr1 cr2 cr3
select style of delay for carriage return (see ioctl(2))
nl0 nl1 nl2 nl3
select style of delay for linefeed
tab0 tab1 tab2 tab3
select style of delay for tab
ff0 ff1 select style of delay for form feed
bs0 bs1 select style of delay for backspace
tty33 set all modes suitable for the Teletype Corporation Model 33 terminal.
tty37 set all modes suitable for the Teletype Corporation Model 37 terminal.
vt05 set all modes suitable for Digital Equipment Corp. VT05 terminal
tn300 set all modes suitable for a General Electric TermiNet 300
ti700 set all modes suitable for Texas Instruments 700 series terminal
tek set all modes suitable for Tektronix 4014 terminal
hup hang up dataphone on last close.
-hup do not hang up dataphone on last close.
0 hang up phone line immediately
50 75 110 134 150 200 300 600 1200 1800 2400 4800 9600 exta extb
Set terminal baud rate to the number given, if possible. (These are the speeds supported by the DH-11 interface).
SEE ALSO ioctl(2), tabs(1)STTY(1)