File type compatibility issue with Perl

D

\Dandy\ Randy

Hey everyone, perhaps someone could shed some light on this issue. I'm
writing a script that maintains an addressbook online with a Perl flatfile
database. The script was working fine until I renamed the database files
from ".txt". to ".db" All entries in the database are on separate lines.
When the database had a ".txt" extension, and I viewed the data, all data
appeared on separate lines as constructed.

Name 1
Name 2
Name 3

When I renamed the extensions to ".db", the data appears on a single line.

Name 1Name 2Name 3

Can anyone tell me why this is happening? I would like to retain the .db
extensions if at all possible. TIA!

R
 
M

Michael Budash

maybe i'm missing something. what do you mean by "appears".
viewing it in an editor or printing it?
the following works for me:
02:48am tina@lux:tests 498> cat test.txt
Name 1
Name 2
Name 3
02:49am tina@lux:tests 499> mv test.txt test.db
02:49am tina@lux:tests 500> cat test.db
Name 1
Name 2
Name 3
02:49am tina@lux:tests 501>

maybe you should as well show some relevant lines of the
script...

The data appears on the same line when I view the data in notepad.[/QUOTE]

one more case of a micro$oft product trying to think for us...
 
G

Garry Short

Dandy" Randy said:
Hey everyone, perhaps someone could shed some light on this issue. I'm
writing a script that maintains an addressbook online with a Perl flatfile
database. The script was working fine until I renamed the database files
from ".txt". to ".db" All entries in the database are on separate lines.
When the database had a ".txt" extension, and I viewed the data, all data
appeared on separate lines as constructed.

Name 1
Name 2
Name 3

When I renamed the extensions to ".db", the data appears on a single line.

Name 1Name 2Name 3

Can anyone tell me why this is happening? I would like to retain the .db
extensions if at all possible. TIA!

R

Huh? I can't see this happening, just because you've changed the file
extension. How about showing us the code that writes information to your
file?

Garry
 

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,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top