How can I copy the contents of a file into another file without using cp? [closed]

Ganks4EveR

New Member
I have an XML file that I need to parse with \[code\]Lex\[/code\] but it is not working since it is encoded in UTF-8. However if I open the file copy the contents into an empty file and save it, \[code\]Lex\[/code\] reads it. I tried making \[code\]Lex\[/code\] read UTF-8 but it doesn't work. I also tried converting the file with \[code\]iconv\[/code\] but it doesn't do it, a byte diff comparison says the converted and the original are the same.Do you have any ideas how I can perform the operation above on the command line or in c (without reading and rewrirting the whole file, which I haven't tried yet). EDIT: Answer:Apparently if you are trying to parse UTF documents in \[code\]Lex\[/code\] you shouldn't have literal characters in your grammar. For example in stead of matching an XML element like this:\[code\]<ID ID'='ATT.../>\[/code\]you should do:\[code\]OT ID ID ASSIGNOP ATT ... SL CT\[/code\]where \[code\]OT\[/code\],\[code\]CT\[/code\], and \[code\]SL\[/code\] are tokens corresponding to <, > / matched in the \[code\]Lex\[/code\] file.Thanks for the suggestions.
 
Back
Top