Comparison of two CSV s to eliminate unused VDIs
Hello
I currently have a script running in my environment that returns a list of users allowed to VDI and their last connection time. I then a manual process in which I line up with the VDI logon names the user was logged in so that I can remove all of them. I would like to automate this process by using a script.
The first script creates a .csv in the following format:
VDIPool, user, status, LastLogon
CorpW764QA-DT, User1, active, 20/07/2013-08:46
CorpW764QA-DT, User2, people with disabilities, 02/09/2013-16:39
CorpW764QA-DT, user3, active, 20/09/2013-19:06
Unfortunately, this .csv file does not include the names of the VDIs registered users in. I would like to compare this list to the csv that I get from VDI administrator when I right click and the content of the export that Table I can get a list of unused VDIs, I can delete. Here is the output of the webpage administrator VDI (Desktop tab + right click-> export table contents):
Desktop computer, pool, name DNS, Version, data store, User Agent, host, status
Desktop1,CorpW7QA-DT,Desktop1.mydomain.local,mydomain.local\User1,esxqa41yyz.mydomain.local,4.5.0,[Store1],remote,available
Desktop2,CorpW7QA-DT,desktop2.mydomain.local,mydomain.local\User2,esxqa43yyz.mydomain.local,4.5.0,[Store1],remote,available
Desktop3,CorpW7QA-DT,desktop3.mydomain.local,mydomain.local\User3,esxqa72yyz.mydomain.local,unknown,[Store1],remote,available
Match the output of the 1st .csv upward with the names of desktop provides in the 2nd .csv? My final goal is to identify all the VDIs which are provided to users who are not logged in them a lot of time so that I can remove them.
Thank you!
Try something like this
$stations = import-Csv.\vdistations.csv - UseCulture
$logons = import-Csv.\vdilogons.csv - UseCulture
$notUsed = @)
{foreach ($vdi to $stations)
$vdiUser = $logons | where {$_.} User - eq $vdi. {User.Split('\') [1]}
{if(!$vdiUser)}
$notUsed += $vdi
}
}
$notUsed
Tags: VMware
Similar Questions
-
Merge two csv files both with the same columns
Hi all
I have two csv files (attached) both with the same DS column headings that I seek to merge into a csv file. I am struggling to find a way to do it.
The two files are already sorted by DS but have additional info not required in the column of the DS. What I need is a cmdlet that will read each column DS each csv, correspond to lines and combine in a csv file.
Any help, advice, much appreciated.
Best,
Rob.
Save the script in the current folder as join - Collections.ps1, then do
$csv1 = Import-Csv LunUUIDtoDS.csv -UseCulture $csv2 = Import-Csv VMtoDS.csv -UseCulture .\Join-Collections.ps1 $csv1 "DS" $csv2 | Export-Csv mergedCSV.csv -NoTypeInformation -UseCulture
-
1. I have ot make a VI for verification nuumber two if equal, greater or lesser.
2 attached is VI.
3. If the numbers are equal then print zero, if one is greater than 1, if its less print 2.
4. I do not understand how to do it. When I put the output of three to digital output then its error, because we cannot do.Vindhyachal.Takniki wrote:
@johnsold, how to do this. I have attached a VI. When a place a table it appears on the façade also, I did not play. On the front, there will be two number & an output.
Build table allows you to create a table of Boolean in your results of the comparison, then Boolean table number to obtain a corresponding number. You can then wire this result number in the selector of the case.
-
Hello
I am a beginner absolut for LabView and I learned LV tutorials, but I have a question and need your help.
I have two digital inputs and one digital output and I want to output for example as many entries. What I need is how to compare two entry and decide for one of them.
When I use a comparison operator as equal or smaller, I get a Boolean result but not a numeric. How can I use this to get for example the bigger or smaller?
Thank you
Oliver
For example, you can use your superior decide who is actually higher then select this one through a structure of matter or a Select who will send you one to forward more great.
That functionality is already attached to the Min/Max function, check it out.
/Y
-
Hello
I have two tables USERS and LISTS:
And I want that there is a comparison between these two tables executed when user table USERS connect to the application.
They must compare the columns between the SEXES and AGE and if some users have the same attributes in its ranks as in a line in the table LISTS (here is unique each line) so that the user gets in his line in the column 'LIST_ID' the ID of the line with which attributes between GENDER and AGE.
Example:
USERS TABLE: exampleuser | Boby | McGrahem | Male | 18. -------
LISTS OF TABLE: 28 | examplelist | Male | 18
Once the Login of the user Boby gets in its ranks the ID = 28 because the SEX and AGE corresponds to the row of table LIST:
Result:
USERS TABLE: exampleuser | Boby | McGrahem | Male | 18. 28
CREATE TABLE "USERS" ( "USERNAME" VARCHAR2(15) NOT NULL ENABLE, "FORRNAME" VARCHAR2(15) NOT NULL ENABLE, "SURNAME" VARCHAR2(15) NOT NULL ENABLE, "GENDER" VARCHAR2(10) NOT NULL ENABLE, "AGE" NUMBER, "LIST_ID" NUMBER, CONSTRAINT " USERS_PK" PRIMARY KEY ("USERNAME") USING INDEX ENABLE
CREATE TABLE "LISTS" ( " LIST_ID" NUMBER NOT NULL ENABLE, " LISTNAME" VARCHAR2(50) NOT NULL ENABLE, "GENDER" VARCHAR2(10) NOT NULL ENABLE, "AGE" VARCHAR2(3) NOT NULL ENABLE, CONSTRAINT " LISTS_PK" PRIMARY KEY ("LIST_ID") USING INDEX ENABLE
I need help for coding this, if someone be so good.
This is my essay:
DECLARE v_listid varchar2(100); BEGIN SELECT LIST_ID into v_listgid FROM LISTS WHERE GENDER = (SELECT GENDER FROM USERS WHERE UPPER(TRIM(USERNAME)) = UPPER(TRIM(:APP_USER))) AND AGE = (SELECT AGE FROM USERS WHERE UPPER(TRIM(USERNAME)) = UPPER(TRIM(:APP_USER))); UPDATE USERS SET LIST_ID = v_listid WHERE UPPER(TRIM(USERNAME)) = UPPER(TRIM(:APP_USER)); END;
I'd like to REALLY shy away using the USER name as the primary key, because the fact that users can create duplicate user names... YOU should NEVER base a PK on the entry of user, the better to let the database create and maintain this element of date...
FIX:
UPDATE to users U
SET List_Id = (SELECT List_Id OF lists L WHERE L.Gender = U.Gender and L.SOMENUMBER = U.SOMENUMBER) AND
Upper (U.UserName) = UPPER(:APP_USER);
Don't really want to cut the strings, Oracle which will do since they are of type varchar2 columns...
Thank you
Tony Miller
Software LuvMuffin
Ruckersville, WILL -
Comparison of two values Datetime, but only the part of everyone's schedule
Hello. I have two Datetime objects on my form. Both are formatted and only display the HH:MIPM. I have a validation requirement where I have to check if: TimeA is higher (: TimeB - 30 minutes). What would be the best way to build an IF condition allows to assess both these Datetime variables and determines if the time portion to: TimeA is greater than the time portion of: TimeB - 30 minutes? The part 'date' Datetime value should not be taken into account in the comparison.
Any help would be greatly appreciated.
Published by: Buechler on April 13, 2010 10:43If you really want to ignore the date and to assess the time, I would like to convert it each date to CHAR formatted as time column and convert it back dated to essentially match the date part. You can then perform a calculation of standard date to get the time difference and check if the difference is more than 30 minutes. For example:
DECLARE TIME_B DATE := To_Date(To_Char(:DATA_BLOCK.TIME_B,'HH24:MI:SS'),'HH24:MI:SS'); TIME_A DATE := To_Date(To_Char(:DATA_BLOCK.TIME_A,'HH24:MI:SS'),'HH24:MI:SS'); BEGIN IF ( ABS(TIME_B - TIME_A) > .021 ) THEN /* If you divide 30/1440 you get the numeric equivilent of 30 minutes. (.021) */ -- Differnece is greater than 30 minutes! -- Do Something Here.... ELSE -- Difference is LESS than 30 minutes! -- Do Something here.... END IF; END;
I hope this helps.
Craig... -
I compare two documents and I can see the differences, but there is a progress screen that stays on top and doesn't seem to end. Any ideas?
Use of Adobe Acrobat Pro 8.1 Windows DC
My solution has been to save the file and open it again.
-
Hi all
Employee table should accept the definition name and column of file while EMP_temp must accept the column definition only.
Should compare employee and EMP_TEMP
CREATE TABLE employee
(INPUT_FILE VARCHAR2 (100 BYTE),
COLUMN_DEFINITION VARCHAR2 (4000 BYTES)
)
CREATE TABLE EMP_TEMP
(COLUMN_DEFINITION VARCHAR2 (4000 BYTE)
)
INSERT INTO employee VALUES ('EMP_Sets.csv ',' emp_Id dept_ID; sal");
INSERT INTO EMP_TEMP VALUES
(emp_id, dept_id, first_name, last_name, sal);
power required:
Number of columns in the Employee table:
Number of columns in the input file
Can anyone suggest me.
Thanks in advance
-
Comparison of two collection objects
Hi all
I need to compare 2 lists of e-mail addresses and eliminate common e-mail found in both lists.
Issues, it is each list contains more than 300,000 e-mail addresses. Is it possible to store values of this size in collectibles (for example, 'Set')?
What is the best way to do this?
Thanks in advance!user3578038 wrote:
Issues, it is each list contains more than 300,000 e-mail addresses. Is it possible to store values of this size in collectibles (for example, 'Set')?If you have the memory, of course.
What is the best way to do this?
I do it with the standard unix commands, concatenate lists and sort / uniq on it.
You are a spammer (or a spammer aspiring) or why do you 300 000 email addresses?
-
Value of aggrigate of procedure - Get Oracle on the comparison of two-column based
Hi all
I've written a procedure that accepts an input parameter and returns a refcursor.
The logic used in the procedure is:
The procedure is used to display the summary and the report in detail. When the input parameter has more than one saperated comma then it will act as a synthesis report, and when there is just a value as input, then it will act like a detailed report.
The input parameter is as "AA12345, BB45434, HJ89736," the first two characters is Brand_id and the rest of the 5 character is the propery_id.
The aggrigation of aggrigation query is:
Select Month_name, Year, sum (REVPAR), Sum (ADR) in the FIS_KPI_TREND where
Brand_id = 'AA' and SIte_id = '12345' Month_name group, year;
The above query will worke fine for detail report when there is just a value for the entry as 'AA12345 '.
The problem is coming to the summary report when I need to get the value of aggrigated for all the brand and the site which is entered in the input parameter.
So I changed the query in the form:
Select Month_name, Year, sum (REVPAR), Sum (ADR) in the FIS_KPI_TREND where
Brand_id | SIte_id in ('AA12345', 'BB45434', 'HJ89736') of the Group of Month_name, year;
(I use parser function to parse a comma saperated values.)
By doing this, I get the desired result, but the performance has decrised that the Index is based on Brand_id and Site_id but I'm using Brand_ID | Site_id for my research.
The one you suggest another way to rewrite this query so that it can take the index and not give me the output of sesired.
Database used: Oracle 10 g
Thanks in advance.
Sumit Narayan
Published by: Sumit Narayan, 11 April 2010 22:00I'd be inclined to do something like that to analyze the list separated by commas, that allows you to join without the concatenation of the columns as you do now.
ME_XE?select substr(column_value, 1, 2) as brand_id, substr(column_value, 3, length(column_value)) as site_id from table(sys.ODCIVARCHAR2LIST('AA12345','BB45434','HJ89736')); 2 3 4 BRAND_ID SITE_ID ---------- ---------- AA 12345 BB 45434 HJ 89736 3 rows selected. Elapsed: 00:00:00.20 ME_XE? ME_XE?select * from v$version; BANNER ---------------------------------------------------------------- Oracle Database 10g Express Edition Release 10.2.0.1.0 - Product PL/SQL Release 10.2.0.1.0 - Production CORE 10.2.0.1.0 Production TNS for Linux: Version 10.2.0.1.0 - Production NLSRTL Version 10.2.0.1.0 - Production 5 rows selected. Elapsed: 00:00:00.39 ME_XE?
So for your case...
Select f.Month_name, f.Year, sum(f.REVPAR), Sum(f.ADR) from FIS_KPI_TREND f, table(sys.ODCIVARCHAR2LIST('AA12345','BB45434','HJ89736')) t where f.Brand_id = t.brand_id and f.SIte_id = t.site_id group by f.Month_name, f.Year;
Published by: Tubby 11 April 2010 22:12
-
SQL to do a similar comparison against two concatenated columns...
I'm doing a similar search against two columns that contain a first name, but people could touch as "John Doe"
Can I do a similar search against concatenated columns?
Kinda what I want to do...
Select * FROM worker_view WHERE
(LOWER (E.USUALFIRSTNAME) |) ' ' || Lower (E.LastName)) LIKE '% searchstring % '.
... but of course this isn't true... any direction would be appreciated!Let's take your example as test case
First name: John
First name: DoeChannel search possibilities:
'John' 'Doe' 'John Doe' 'Doe John'
SQL statement:
SELECT * FROM worker_view WHERE LOWER(E.USUALFIRSTNAME) LIKE LOWER('%searchstring%') OR LOWER(E.LASTNAME) LIKE LOWER('%searchstring%') OR LOWER(E.USUALFIRSTNAME) || ' ' || LOWER(E.LASTNAME) LOWER('%searchstring%') OR LOWER(E.LASTNAME) || ' ' || LOWER(E.USUALFIRSTNAME) LOWER('%searchstring%')
We'd still miss that follows:
'JohnDoe' 'DoeJohn' 'John Doe' 'Doe John'
Hope that should be fine with your application.
-dkv
-
No sequences present in the comparison of two models of auto-increment columns and triggers
Hi, I'm using Oracle SQL Developer Data Modeler version 4.0.3 and I get the same behavior described in the
.Y at - it an update on this issue?
Thank you
Hello
No DOF preview is currently generated differences in properties on the auto-increment columns properties page.
However, if you create a sequence with the relevant name (and the user as appropriate) in your physical model Oracle, then its properties will be used instead of the ones on the page Auto Increment, and in this case the DOF preview will include the DDL for changes in its properties, e.g.
FALL OF SEQUENCE "TABLE_1_SEQ".
;
CREATE SEQUENCES "TABLE_1_SEQ."
START WITH 5
INCREMENT OF 10
;
If only the increment "by" is changed, an ALTER SEQUENCE will be generated:
CHANGE THE SEQUENCE "TABLE_1_SEQ".
INCREMENT OF 10
;
David
-
Error in the comparison of two numbers
Hello
I have the columns value_from and value_to both are number data type.
I check if level_value_from is greater than level_value_to, I need to throw an exception.
To do this, I wrote below, his mistake by giving the code. Can someone suggest me please a simple logic.
String Level1Frm = pageContext.getParameter ("Level1From");
String Level1To = pageContext.getParameter ("Level1To");
If ((null! = Level1Frm) & & (null! = Level1To) & & (""! ")) = Level1Frm) & & (""! ") = Level1To))
{
Number of numLevel1Frm = new number (Level1Frm);
Number of numLevel1To = new number (Level1To);
}
If (numLevel1Frm < numLevel1To)
{
throw new OAException ("is superior To", OAException.ERROR);
}
}
This is in error, can someone help me how to solve this problem?
Thank you
MaheshIt works:
If (pageContext.getParameter ("compare")! = null)
{
String s1 = pageContext.getParameter ("num");
String s2 = pageContext.getParameter ("num1");
Number n1 = null;
Number n2 = null;
try {}
N1 = new Number (s1);
N2 = new Number (s2);
} catch (System.Exception e)
{
e.printStackTrace ();
}
If (N1.intValue () > n2.intValue ())
{
throw new OAException ("num1 > num2", OAException.ERROR);
} else
{
throw new OAException ("num2 > = num1", OAException.ERROR);
}
} -
Integrated graphic how of waveform of CSV data
Hello
I had the waveform of the comparison of two methods as follows.
As we do a right click on the waveform graph and export the data to Excel and CSV format.
a CSV file is generated.
I want that same CSV file can be used to display the waveform graph, as is (for later analysis).
I am using the following Code, but not getting results.
Please suggest changes, the data file CSV and VI is attached for reference.
Concerning
MMS79
-
JDeveloper 12.1.3
I want to make sure component based on the comparison of two date, something like:
< af:outputText value = "(Expired)" id = "ot3" inlineStyle = "color: Red; '" make-weight: bold; »
rendering = "#{now > links.}" EndDate.inputValue} "/ >"
"now" is java.util.Date from registered managed bean (thin layer of ADF/JSF) while the EndDate above origin of VO (EO-based) and is default java.sql.Timestamp so cannot quite compare the two.
What is the recommended way to do this?
I was able to create a bean:
public class NowTimestamp {}
Timestamp private now;
public void setNow (Timestamp now) {}
This.now = now;
}
public Timestamp getNow() {}
java.util.Date date = new java.util.Date ();
return of new Timestamp (date.getTime ());
}
}
then use rendered = "#{datebean.now > links.}" EndDate.inputValue}"but read while it is not recommended to have sql. Timestamp in the user interface.
First rule of the ADF: stop your instincts and start to put your logic in the transient VO attributes, rather than on the safeguarding of the beans.
To do this, you must create a transitional type VO Boolean attribute, allows to call this attribute "expired".
In ViewRowImpl.getExpired, you will have:
public Boolean getExpired() {}
Since a long time now = System.currentTimeinMillis ();
Timestamp nowTS = new Timestamp (now);
{if (getEndDate () .after (nowTS))}
Returns false;
}
Returns true;
}
rendering = "#{bindings." Expired.inputValue} "/ >"
Maybe you are looking for
-
The quality of the text on Web sites is pretty poor thin type and definition blurred, but images are good. The quality is much worse than IE8 on the same computer.
-
Right now, I currently own a normal laptopn who weighs about 5 lbs. Computer of mg is a pain to get to school or to visit family in the city. Lately I've been saving up for a new device. An iPad or a Macbook? I'm torn between the two. With the iPad,
-
Satellite L300D - need help with the installation of the display driver
Hello For 1 month, I need to update my display on my Satellite L300D driver (PSLC8C - 06NO19) with an ATI RADEON 3100. I tried to download the drivers on the Ati site, but when the installation has finished, nothing has changed. My driver is still th
-
HP laptop PC 14 14-g008AU: restart sudden
Hello.. I have a problem with my laptop here. My product is 14 Hp notebook pc 14-g008AU, 4 GB of RAM and windows 7 64-bit. Keep restarting my device whenever I play / watch movie to a dvd or a file (even if the film / video only a minute or two as a
-
My problem is the same... None of my USB ports work. I have disabled by mistake all and then discovered that my keyboard and mouse no longer work. I went into Setup and tried to allow them this way, but it did not work. I can go to Safe Mode and my a