| View previous topic :: View next topic |
| Author |
Message |
hiddenop Guest
|
Posted: Mon Jun 06, 2005 12:21 pm Post subject: problem with reading a file !! |
|
|
hi,
i got a log file with the " | " character (the pipe) into it. Each time i try to read the line, it went to carriage return
exemple
filelog.dat
- -cut
[ Network Services ]
- Check Daemons : more /etc/inetd.conf (Linux xinetd.conf )
- Processes : ps –ef | more
------------ cut here
my logviewer
Loop, read, %database%,`r`n
{
List = %A_LoopReadLine%
GuiControl, 1:, tbox, "|"
GuiControl, 1:, tbox, %List%
}
---
results
[ Network Services ]
- Check Daemons : more /etc/inetd.conf (Linux xinetd.conf )
- Processes : ps –ef <-------------- HERE HE DOESNT DISPLAY THIS SUCKING 'pipe' ????
more
HELP, i'm going crazy ! |
|
| Back to top |
|
 |
toralf
Joined: 31 Jan 2005 Posts: 3841 Location: Bremen, Germany
|
Posted: Mon Jun 06, 2005 1:34 pm Post subject: |
|
|
Hi,
you could use StringReplace to replace all | with `|
| Code: | Loop, read, %database%,`r`n
{
StringReplace, List, A_LoopReadLine, |, `|, All
GuiControl, 1:, tbox, |%List%
} |
_________________ Ciao
toralf  |
|
| Back to top |
|
 |
Decarlo110
Joined: 15 Dec 2004 Posts: 303 Location: United States
|
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10480
|
Posted: Tue Jun 07, 2005 12:18 am Post subject: |
|
|
The suggestions above will probably not work because I don't think there's any support for it yet. An option to choose a different delimiter needs to be added so that the pipe character can act like a normal character. I'll make sure this is on the to-do list for the near future.
Edit: The ability was recently added to customize the delimiter to something other than pipe. See Gui +Delimiter.
Last edited by Chris on Thu Aug 18, 2005 9:58 am; edited 1 time in total |
|
| Back to top |
|
 |
Rubberduck
Joined: 24 Apr 2005 Posts: 96
|
Posted: Tue Jun 07, 2005 12:25 am Post subject: |
|
|
If Chris says there is a problem then maybe using a external programm is helping.
With a quicksearch in google I found this link:
http://www.tylogix.com/Downloads/Download%20Intro/TYLOGIX%20Download%20REPCHAR.htm
I don't know if it helps, but there are surely a lot of other utilities
that can replace characters in a file that helps solving your problem.
Greetings  _________________ Wer keine Antworten hat muss nicht dumm sein,
dumm ist nur der welcher keine Fragen hat. |
|
| Back to top |
|
 |
toralf
Joined: 31 Jan 2005 Posts: 3841 Location: Bremen, Germany
|
Posted: Tue Jun 07, 2005 6:19 am Post subject: |
|
|
Hi rubberduck,
I don't think that tool is a real help. It just does the replacement. That isn't the problem with AHK. StringReplace will replace the replace the pipe. As far as I understood Chris post, the problem is the GUI control. As soon as there is a pipe (escaped or not) the control starts a new line. So the only current way is to replace the pipe with a different string or character. _________________ Ciao
toralf  |
|
| Back to top |
|
 |
Rubberduck
Joined: 24 Apr 2005 Posts: 96
|
Posted: Tue Jun 07, 2005 6:41 pm Post subject: |
|
|
That was my idea with the little external program.
hiddenop should first call a external util to replace any
Pipe in his lof-file with another character.
Then he can read the file (withut pipes) with AHK.
Was only an idea  _________________ Wer keine Antworten hat muss nicht dumm sein,
dumm ist nur der welcher keine Fragen hat. |
|
| Back to top |
|
 |
|