printing escape characters

P

pelonbiologo

Hi

I have several tab delimited files and I wanted to make sure that the
entries in these files were actually tab delimited, By printing in some
way the escape characters for example:

Name Address (would become)

Name\tAddress\t (this)

I would also be interested in printing \s and \n etc...

Cheers!
 
S

Shane

Hi

I have several tab delimited files and I wanted to make sure that the
entries in these files were actually tab delimited, By printing in some
way the escape characters for example:

Name Address (would become)

Name\tAddress\t (this)

I would also be interested in printing \s and \n etc...

Cheers!

Would Data::Dumper be what you are looking for?
 
J

John Bokma

Hi

I have several tab delimited files and I wanted to make sure that the
entries in these files were actually tab delimited, By printing in some
way the escape characters for example:

Name Address (would become)

Name\tAddress\t (this)

I would also be interested in printing \s and \n etc...

replace \t with something else, for example xxxxxx
or split on \t, and join with a more visible character
or split on \t and count the number of items
etc.
 
A

Anno Siegel

John Bokma said:
replace \t with something else, for example xxxxxx
or split on \t, and join with a more visible character
or split on \t and count the number of items
etc.

Some care must be taken when using split() for this. Per default split()
suppresses trailing empty fields.

Anno
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top