I have a "strings" file, like this:
I want to grep/sed/awk/perl/??? this file into xargs, then into PListBuddy, to create a plist file, an array whose items are just the keys:
The first problem is that grep chokes, because although this file is English, the other files used in localizing these keys are in Japanese & French... and so they are UTF16. In UTF16, the first two bytes are "??", whatever they are exactly, and grep thinks the whole thing is binary.
I suppose I need perl, but perl has always been a bit too complicated for me. Can you plz help me spit out just the keys from a file like this into xargs then plistbuddy... Thx.
PS: I can't find that "resolved" option???
Code:
//
// DMGeneralErrorDomain
kDevelopmentTestError = "Unless you are the programmer, you should not be seeing this.";
kNilOrEmptyDictionary = "Dictionary was nil or empty.";
kNilOrMissingResource = "Resource was nil or missing.";
kOSFileOperationError = "A file system operation error occurred.";
kUnreachableCodeBlock = "An unreachable code block was reached.";
I want to grep/sed/awk/perl/??? this file into xargs, then into PListBuddy, to create a plist file, an array whose items are just the keys:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
<string>kDevelopmentTestError</string>
<string>kNilOrEmptyDictionary</string>
<string>kNilOrMissingResource</string>
</array>
</plist>
The first problem is that grep chokes, because although this file is English, the other files used in localizing these keys are in Japanese & French... and so they are UTF16. In UTF16, the first two bytes are "??", whatever they are exactly, and grep thinks the whole thing is binary.
I suppose I need perl, but perl has always been a bit too complicated for me. Can you plz help me spit out just the keys from a file like this into xargs then plistbuddy... Thx.
PS: I can't find that "resolved" option???
Last edited: