This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

backslash in hive regexp_replace function?

 
Joseph Hwang
Greenhorn
Posts: 17
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I try to replace backslash(\) to slash(/) of string "L\F\W\A\5\LFWA55MATRQ647N.csv" in Hive regexp_replace function with java.
The result string I want is "L/F/W/A/5/LFWA55MATRQ647N.csv"

This is source

String sql = "select trim(regexp_replace(filename,'\', '/')) from table";
res = stmt.executeQuery(sql);
while (res.next()) {
System.out.println(res.getString(1));
}
...
using JDBC.But the result string is like below

/L/\/F/\/W/\/A/\/5/\/L/F/W/A/5/5/M/A/T/R/Q/6/4/7/N/./c/s/v/ / / / / / / / / / / /

Any advice will be appreciated.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic