AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

problem with reading a file !!

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
hiddenop
Guest





PostPosted: Mon Jun 06, 2005 12:21 pm    Post subject: problem with reading a file !! Reply with quote

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

PostPosted: Mon Jun 06, 2005 1:34 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
Decarlo110



Joined: 15 Dec 2004
Posts: 303
Location: United States

PostPosted: Mon Jun 06, 2005 7:32 pm    Post subject: Reply with quote

If that doesnt work, try {} around it.

And if that doesn't work, try using another text editor for this particular operation, namely, WordPad or Metapad. Some text editors, Notepad being one of these, dont fully support Unicode characters, but there are workarounds.

But you don't need to switch editors.. AutoHotkey can do many things more than one way... Have a look at the following links:

http://www.autohotkey.com/forum/viewtopic.php?t=3513
http://www.autohotkey.com/forum/viewtopic.php?t=3634
_________________
1) The Open Source Definition http://www.opensource.org/docs/definition_plain.php

2) Intuitive. Logical. Versatile. Adaptable. <<AutoHotkey>>
Back to top
View user's profile Send private message
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10480

PostPosted: Tue Jun 07, 2005 12:18 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Rubberduck



Joined: 24 Apr 2005
Posts: 96

PostPosted: Tue Jun 07, 2005 12:25 am    Post subject: Reply with quote

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 Very Happy
_________________
Wer keine Antworten hat muss nicht dumm sein,
dumm ist nur der welcher keine Fragen hat.
Back to top
View user's profile Send private message
toralf



Joined: 31 Jan 2005
Posts: 3841
Location: Bremen, Germany

PostPosted: Tue Jun 07, 2005 6:19 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
Rubberduck



Joined: 24 Apr 2005
Posts: 96

PostPosted: Tue Jun 07, 2005 6:41 pm    Post subject: Reply with quote

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 Confused
_________________
Wer keine Antworten hat muss nicht dumm sein,
dumm ist nur der welcher keine Fragen hat.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group