hey all - i imported a folder full of text (*.txt) documents (recipes, actually) into my Pi for the purposes of accessing them as needed on a shared network. everything looked good on the surface, but now i find that when i actually open each file, it is incomplete or scrambled (most characters are missing, crazy font sizes, scrambled words etc).
not sure what went wrong here - these docs were basically recipes from websites that were copied and pasted into Windows notepad and then saved as text files. once my Pi was in place, I copied the files into the Pi's public folder. would anyone know if this is a Linux problem or a Pi problem or both?
thanks!
-
- Raspberry Pi Engineer & Forum Moderator
- Posts: 5710
- Joined: Wed Aug 17, 2011 7:41 pm
- Location: Cambridge
Re: corrupted text files
If you copy them back to the original PC, can you view them? That will detemine if the files are corrupted, or it's an encoding issue.
What are you using to view them on the Pi?
What are you using to view them on the Pi?
Re: corrupted text files
thanks for the reply! just to be clear:
- if i open the file on the Pi itself, it opens with Leafpad and is completely blank.
- if i open the file on the Pi via a Windows machine over the network, it opens with Notepad and is incomplete, missing significant portions of the text.
- if i copy the file from Pi back to a Windows machine, it opens with Notepad and is incomplete.
- i still have the original folder on a Windows, machine, with all files intact...but i'd like to them intact on the Pi in the kitchen - that's why i put it there in the first place!
thanks again!
- if i open the file on the Pi itself, it opens with Leafpad and is completely blank.
- if i open the file on the Pi via a Windows machine over the network, it opens with Notepad and is incomplete, missing significant portions of the text.
- if i copy the file from Pi back to a Windows machine, it opens with Notepad and is incomplete.
- i still have the original folder on a Windows, machine, with all files intact...but i'd like to them intact on the Pi in the kitchen - that's why i put it there in the first place!
thanks again!
Re: corrupted text files
I have a feeling they are not raw text files as you say that the fonts are wrong. But a raw text files (*.txt) doesn't have the ability to have different fonts. What generated the files?hanna wrote:thanks for the reply! just to be clear:
- if i open the file on the Pi itself, it opens with Leafpad and is completely blank.
- if i open the file on the Pi via a Windows machine over the network, it opens with Notepad and is incomplete, missing significant portions of the text.
- if i copy the file from Pi back to a Windows machine, it opens with Notepad and is incomplete.
- i still have the original folder on a Windows, machine, with all files intact...but i'd like to them intact on the Pi in the kitchen - that's why i put it there in the first place!
thanks again!
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.
Re: corrupted text files
sorry, should have been clearer - some of the font sizes are off, not the font itself. primary problem however is just an incomplete document with paragraphs, sentences etc missing.
as i notes below, the files were just recipes, blocks of text copied off of websites and pasted into Notepad and saved as .txt files.
as i notes below, the files were just recipes, blocks of text copied off of websites and pasted into Notepad and saved as .txt files.
Re: corrupted text files
Hmm. Still odd. Font type, sizes etc are not supported in a raw text file - all you get are characters, and paragraphs are only there because of carriage returns, not through any formatting instructions. If they were cut and pasted from websites, they are perhaps HTML formatted? But then I wouldn't expect things to disappear - just more stuff to appear!hanna wrote:sorry, should have been clearer - some of the font sizes are off, not the font itself. primary problem however is just an incomplete document with paragraphs, sentences etc missing.
as i notes below, the files were just recipes, blocks of text copied off of websites and pasted into Notepad and saved as .txt files.
Can you post one of the files to somewhere it can be downloaded - or perhaps can you cut and paste something in to a 'quote' section in here?
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.
Re: corrupted text files
another thing to consider doing is to rename one of the text files to end with the .html extension, and see what it looks like if you view it in a browser on your pi.
FORUM TIP: To view someone's posting history, sign in, click on their user name, then on "Search User's Posts." || Running ArchLinuxArm on Model 2B and 512MB Model B
Re: corrupted text files
ok, see the attached zip file. now, i like to use Greek yogurt instead of regular....wait, what? oh sorry, wrong forum
anyway, i put two txt files, before and after being copied over to my Pi, in the attached zip file - not much to see but that should illustrate my problem.
thanks!

anyway, i put two txt files, before and after being copied over to my Pi, in the attached zip file - not much to see but that should illustrate my problem.
thanks!
Re: corrupted text files
How did you "import" the folders into the Pi? Windows uses different line endings than *nix systems (carriage return, newline in DOS/Windows vs. just newline in Linux) which can sometimes make text look different or cause problems with scripts.
When I viewed your after example in ghex which shows both hex codes and ascii, the file was a bunch of hex zeros ending with hex 59 6F which in ascii is "Yo".
I usually either use scp to copy files between systems, or use USB memory stick or SD card. But then, I mostly run Linux at home (64-bit Ubuntu 12.04 on my PC).
When I viewed your after example in ghex which shows both hex codes and ascii, the file was a bunch of hex zeros ending with hex 59 6F which in ascii is "Yo".
I usually either use scp to copy files between systems, or use USB memory stick or SD card. But then, I mostly run Linux at home (64-bit Ubuntu 12.04 on my PC).
Last edited by efflandt on Fri Jan 25, 2013 1:29 am, edited 1 time in total.
Re: corrupted text files
Your original file looks to be a normal .txt file (although with CRLF terminators instead of just LF, which is normal for DOS/Windows and shouldn't be a problem).
The "Pi" file is just junk. 512 bytes of NULL followed by "Yo".
Something is definitely corrupting the file.
When you say
Hopefully we will get to the bottom of this problem.
Incidentally, I tend to use goat yoghurt. This is because my wife can't eat normal yoghurt.
The "Pi" file is just junk. 512 bytes of NULL followed by "Yo".
Something is definitely corrupting the file.
When you say
, what did you actually do? Is you Pi set up as a Samba share on your network? What commands/method did you use to get the files on your Pi?i imported a folder full of text (*.txt) documents (recipes, actually) into my Pi
Hopefully we will get to the bottom of this problem.
Incidentally, I tend to use goat yoghurt. This is because my wife can't eat normal yoghurt.

Re: corrupted text files
yup. i set up Samba on the Pi in order to see my shares (and vice versa) on my Windows machines. if i recall, i just copied and pasted the recipe files right into the Public folder on the Pi, via the network . thought i was all set until i actually went to open one of the files (all the file names looked normal.)
not knowing much about Linux, it never occurred to me this could be a problem. so, how would you copy a Windows text file into a Linux?
thanks!
not knowing much about Linux, it never occurred to me this could be a problem. so, how would you copy a Windows text file into a Linux?
thanks!
- Burngate
- Posts: 6427
- Joined: Thu Sep 29, 2011 4:34 pm
- Location: Berkshire UK Tralfamadore
- Contact: Website
Re: corrupted text files
I wonder if it's something to do with Linux not writing directly to the SD card, but keeping it in a buffer.
If Samba had allocated space but not written the file, you'd get garbage
If Samba had allocated space but not written the file, you'd get garbage
Re: corrupted text files
It should work...
Try copying them again. Check they are right before you switch the Pi off, (and shutdown the Pi properly with "sudo halt".)
If that fails, copy them to a USB drive and back into the Pi from there.
Try copying them again. Check they are right before you switch the Pi off, (and shutdown the Pi properly with "sudo halt".)
If that fails, copy them to a USB drive and back into the Pi from there.
Re: corrupted text files
I'm afraid those corrupted text files are a sign of SD card corruption.
I got the same problem when I used Turbo overclocking.
Here is an example of the corrupted file:
I got the same problem when I used Turbo overclocking.
Here is an example of the corrupted file:
- Attachments
-
- es_systems.zip
- (917 Bytes) Downloaded 71 times