Ask a Question related to PERL Beginners, Design and Development.
-
Chandrasekaran Mythili #1
how to extract data in specified format to another file
HI,
I am new to Perl and I need some help regarding tranfering the contents of
one file to other file in specified format using perl.
the problem is i have one file with data(data is in hex) as follows:
48
30
20
2E
2E
2E
0
0
0
i want to copy the contents of this file to another file till 0 is
encountered.that is i want the resultant file to have
4830202E2E2E
what command should i use get all the data in the same line?
any help ASAP is appreciated
Thanks.
Chandrasekaran Mythili Guest
-
Using SDK to Extract Form Data to XML
Dear All, I am having same requirement for a new project in our company, and I am facing difficulty in proceeding forward. I want to use OLE or... -
Extract Data from PDF
Does anyone make a plug-in that would extract info from a PDF for use as a file name? We receive about 50 pdf's each evening, copies of invoices,... -
Linking data, searching data, and format the data file
I'm sorta new to flash and integrating data and components...I'm usu. an interface designer. I'm trying to link a combo box to a file doesn't... -
extract data with csv format
Hi.. could anyone tell me how do I have the data in csv format, so whenenver i click at the lick and dreamweaver page will save the file as csv to c... -
Creating a table using the IXF file format for data exported using a SELECT * statement
Hello, everyone. Which of the following is being kept in the new table? Check constraints Catalog statistics Primary key definitions -
Kevin Pfeiffer #2
Re: how to extract data in specified format to another file
In article
<ECB4515E76FBD411917100D0B7C9F69C0850EE1D@vap1ex31 .vcs.visteon.com>,
Chandrasekaran Mythili wrote:
There is probably some subtlety of handling hexadecimal (just learned how to> HI,
>
> I am new to Perl and I need some help regarding tranfering the contents of
> one file to other file in specified format using perl.
>
> the problem is i have one file with data(data is in hex) as follows:
> 48
> 30
> 20
> 2E
> 2E
> 2E
> 0
> 0
> 0
>
> i want to copy the contents of this file to another file till 0 is
> encountered.that is i want the resultant file to have
>
> 4830202E2E2E
>
> what command should i use get all the data in the same line?
add and subtract it yesterday) that I'm overlooking, but on the surface,
how about something as simple as:
while (<DATA>) {
chomp;
print;
last if /^0$/;
}
print "\n";
--
Kevin Pfeiffer
Kevin Pfeiffer Guest
-
Kevin Pfeiffer #3
Re: how to extract data in specified format to another file
In article <1777126.6tHrYhVHHC@sputnik.tiros.net>, Kevin Pfeiffer wrote:
[...]Whoops, too fast for my own good (points off for carelessness):> while (<DATA>) {
>
> chomp;
> print;
> last if /^0$/;
> }
>
> print "\n";
while (<DATA>) {
chomp;
print unless /^0$/;
}
print "\n";
__END__
But what I'm not sure about (being more cautious now) - could there be '0's
in the valid data? Or are they represented as '00' in hex? (Think so, but
have to look)
--
Kevin Pfeiffer
Kevin Pfeiffer Guest
-
John W. Krahn #4
Re: how to extract data in specified format to another file
Chandrasekaran Mythili wrote:
Hello,>
> HI,
perl -ne'0+$_&&print/./g' file1 > file2> I am new to Perl and I need some help regarding tranfering the contents of
> one file to other file in specified format using perl.
>
> the problem is i have one file with data(data is in hex) as follows:
> 48
> 30
> 20
> 2E
> 2E
> 2E
> 0
> 0
> 0
>
> i want to copy the contents of this file to another file till 0 is
> encountered.that is i want the resultant file to have
>
> 4830202E2E2E
>
> what command should i use get all the data in the same line?
:-)
John
--
use Perl;
program
fulfillment
John W. Krahn Guest



Reply With Quote

